<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button onclick="click_event()">点击事件</button>
    <input type="text" onfocus="focus_event()" onblur="blur_event()" />

    <script>
      // 按钮的点击事件
      function click_event() {
        alert("点击事件触发了");
      }

      // 获得焦点和失去焦点

      function focus_event() {
        console.log("获得焦点");
      }
      function blur_event() {
        console.log("失去焦点");
      }
    </script>
  </body>
</html>
